<template>
<div>
  <mt-header title="更多" class="title">
    <router-link to="/more" slot="left">
      <mt-button icon="back"></mt-button>
    </router-link>
  </mt-header>
  <div class="littleInterval"></div>
  <mt-field label="旧密码" placeholder="请输入旧密码" type="password" v-model="oldPassword"></mt-field>
  <mt-field label="新密码" placeholder="请输入新密码" type="password" v-model="newPassword"></mt-field>
  <mt-field label="再确认" placeholder="再次输入一次新密码" type="password" v-model="repeatNewPassword"></mt-field>
  <div id="submit_div">
    <mt-button type="primary" size="large" @click.native="resetPassword">提交</mt-button>
  </div>
</div>
</template>

<script>
  import { Toast } from 'mint-ui';
    export default {
        name: "ResetPassword",
      data(){
          return{
            oldPassword:'',
            newPassword:'',
            repeatNewPassword:''
          }
      },
      methods:{
        resetPassword(){
          if(this.oldPassword.trim()==""){
            Toast('旧密码不能为空');
            return;
          }
          if(this.newPassword.trim()==""){
            Toast('新密码不能为空');
            return;
          }
          if(this.repeatNewPassword.trim()==""){
            Toast('重复新密码不能为空');
            return;
          }
          if(this.newPassword.trim() != this.repeatNewPassword.trim()){
            Toast('两次输入密码不一致');
            return;
          }
        }
      }
    }
</script>

<style scoped>
#submit_div{
  margin-left: 1rem;
  margin-right: 1rem;
}
</style>
